// load green-turtle
var RDFaInAction = RDFaInAction || {};
RDFaInAction.rdfaAPIhref = RDFaInAction.rdfaAPIhref || "RDFa.js";
if (!document.data) {
   var script = document.createElement("script");
   script.setAttribute("type","text/javascript");
   script.setAttribute("src",RDFaInAction.rdfaAPIhref);
   document.head.appendChild(script);
}

RDFaInAction.firstValue = function(target,subject,property) {
   var values = target.data.getValues(subject,property);
   return values.length>0 ? values[0] : null;
}

document.addEventListener("rdfa.loaded",function() {
   for (var name in RDFaInAction.services) {
      var info = RDFaInAction.services[name];
      info.instance = new info.constructor();
      info.instance[info.method](document);
   }
},false);

